<template>
  <div>
    <li v-for="(item, index) in arr" :key="index">
     <input type="checkbox" v-model="arr2" :value="item"/>{{ item }} 
    </li>
    <p>你选中的数据的累加的值：{{sum}}</p>
  </div>
</template>
  
  <script>
export default {
  data() {
    return {
      arr: [9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
      arr2:[]
    }
  },
  computed:{
    sum() {
     return this.arr2.reduce((pre,item)=>pre+item,0)
    }
  }
};
</script>
  
  <style>
</style>
  